# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=gifski
pkgver=1.13.0
pkgrel=1
pkgdesc="Highest-quality GIF encoder based on pngquant"
url="https://gif.ski/"
license="AGPL-3.0-or-later"
arch="all"
makedepends="cargo clang16-dev ffmpeg-dev cargo-auditable"
source="https://github.com/ImageOptim/gifski/archive/$pkgver/gifski-$pkgver.tar.gz
	bump-ffmpeg-sys-next.patch
	"
options="net" # fetch dependencies

_features="--features=video"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release $_features
}

check() {
	cargo test --frozen $_features
}

package() {
	install -Dm755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
0dec90461ce4182e30d0da061bf691b17aad873ed9f3ea68356bc4b36fd4c80b2aa8694cd539024830afd371716f6a99daeacc09094119ce8cb2d9044820d3a3  gifski-1.13.0.tar.gz
707b355d3a76158f70736d36b7e46bf4f49f3d1f57ba7e29d91f6b127b9547f4b3081363b24090b1ee1b1d3a6e12ee5d963d472d1286e7cb452bc4c807883add  bump-ffmpeg-sys-next.patch
"
